﻿using _16_EF;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace _16_WebApplication1.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MaoYanController : ControllerBase
    {
        private readonly MyDbContent myDbContent;
        private readonly My2DbContext db2;
        public MaoYanController(MyDbContent db, My2DbContext db2)
        {
            this.myDbContent = db;
            this.db2 = db2;
        }
        [HttpGet]
        public string Demo1()
        {
            var b = myDbContent.MaoYans.Count();

            var b2 = db2.MaoYanPersons.Count();
            return $"{b}条数据,person={b2}";
        }
        [HttpGet]
        public string Demo2()
        {
            var b = db2.MaoYanPersons.Count();
            return $"{b}条数据";
        }
    }
}
